//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
// 			VisualNovelToolkit		     /_/_/_/_/_/_/_/_/_/.
// Copyright ©2013 - Sol-tribe.	/_/_/_/_/_/_/_/_/_/.
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
using UnityEngine;
using System.Collections.Generic;

/// <summary>
/// Hide system ui node.
/// </summary>
[AddComponentMenu("ViNo/Nodes/Message/HideMessage")]
[ System.Serializable ]
public class HideMessageNode : ViNode {
	public string targetTextBoxName;
//	public ViNoTextBox targetTextBox;

	public override void ToScenarioScript( ref System.Text.StringBuilder sb ){
		sb.Append( "[hidesystemui]" );
		sb.Append( System.Environment.NewLine );
	}

	public override void ToByteCode( ByteCodes code ){		
		List<byte> byteList  = new List<byte>();

//		if( targetTextBox != null ){
		if( ! string.IsNullOrEmpty( targetTextBoxName ) ){
			CodeGenerator.AddHideMessageCode( byteList , targetTextBoxName );//targetTextBox.name );
			code.Add( byteList.ToArray() ); 
		}
		else{
			Debug.LogWarning( "HideMessageNode target not set." );
		}

		// To Byte codes this Children.
		ToByteCodeInternal( code );
	}

}
